﻿using System;
using System.Windows.Controls;

using Hetymine.Executioner.Commands;

namespace Hetymine.Executioner.Controls {
    /// <summary>
    /// Interaction logic for UnknownCommandConfigurator.xaml
    /// </summary>
    public partial class UnknownCommandConfigurator : UserControl, ICommandConfigurator<ICommand> {
        private UnknownCommand _UnknownCommand;

        public UnknownCommandConfigurator() {
            InitializeComponent();
        }

        #region ICommandConfigurator<ICommand> Members
        public void InitializeConfig(ICommand config) {
            this._UnknownCommand = config as UnknownCommand;
            this.cType.Text = this._UnknownCommand.Type;
            this.cName.Text = this._UnknownCommand.Name;
            this.cCallStrings.Text = String.Join(", ", this._UnknownCommand.CallStrings.ToArray());            
        }
        public UserControl ConfigPanel {
            get { return this; }
        }

        // Unknown events are read only
        public event CommandNameEventHandler CommandNameChanged;
        #endregion
    }
}
